#ifndef GAMEBOARD_H
#define GAMEBOARD_H

#include <QLabel>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QKeyEvent>
#include "game.h"
#include "cell.h"
#include "gameoverwindow.h"
#include "gamewinwindow.h"
#include "resetbutton.h"
class GameBoard : public QWidget
{
    Q_OBJECT
public:
    explicit GameBoard(QWidget *parent = 0);
    ~GameBoard();

private:
    // 创建基本游戏逻辑
    Game game;

    Cell* cells[NCells][NCells] {};

    // main layout
    QVBoxLayout *mainLayout;

    // grid layout of board
    QGridLayout *boardLayout;

    // score widget
    QLabel *score;

    // game over widget
    GameOverWindow gameOverWindow;

    // game win widget
    GameWinWindow gameWinWindow;

    void drawBoard();
protected:
    void keyPressEvent(QKeyEvent *event);
signals:

public slots:
    void resetGameOver();
    void resetGameWin();
};

#endif // GAMEBOARD_H
